﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Com.CMS263.BLL;
using Com.CMS263.PO;
using Com.CMS263.Util;

namespace Com.CMS263.Web.manage.VoteManage
{
    public partial class vote_option_list : System.Web.UI.Page
    {


        public IList<VoteOption> prodlist = new List<VoteOption>();
        VoteOptionBLL abll = new VoteOptionBLL();
        public int page = 0;
        public int pagecount = 0;
        public int pagesize = 10;
        public int tid = 0;
        public VoteTopic vt = new VoteTopic();
        VoteTopicBLL vtbll = new VoteTopicBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                page = Convert.ToInt32(Request["page"]);
                if (page == 0)
                {
                    page = 1;
                }
                tid = Convert.ToInt32(Request["tid"]);
                if (tid > 0)
                {
                    prodlist = abll.GetListByPager(page, pagesize, tid);
                    vt = (VoteTopic)vtbll.FindModelById("VoteTopic", tid);
                }
                else
                {
                    StringUtil.Alert("抱歉,没有找到相关数据", "vote_list.aspx");
                }
            }
        }
        

        
        public string GetPager()
        {
            pagecount = abll.GetListByPager(tid);
            return EnPager.GetPager(pagecount, pagesize, page, "&tid=" + tid);
        }
        
    }
}
